{__NOLAYOUT__}
<!doctype html>
<html>

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>Amaze UI Admin index Examples</title>
    <meta name="description" content="这是一个 index 页面">
    <meta name="keywords" content="index">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="renderer" content="webkit">
    <meta http-equiv="Cache-Control" content="no-siteapp" />
    <link rel="icon" type="image/png" href="__PUBLIC__/Login/assets/i/favicon.png">
    <link rel="apple-touch-icon-precomposed" href="__PUBLIC__/Login/assets/i/app-icon72x72@2x.png">
    <meta name="apple-mobile-web-app-title" content="Amaze UI" />
    <link rel="stylesheet" href="__PUBLIC__/Login/assets/css/amazeui.min.css" />
    <link rel="stylesheet" href="__PUBLIC__/Login/assets/css/admin.css">
    <link rel="stylesheet" href="__PUBLIC__/Login/assets/css/app.css">
</head>

<body data-type="login">
<div class="am-g myapp-login">
    <div class="myapp-login-logo-block  tpl-login-max">
        <div class="myapp-login-logo-text">
            <div class="myapp-login-logo-text">
                Amaze UI<span> upd</span> <i class="am-icon-skyatlas"></i>

            </div>
        </div>

        <div class="login-font">
            <i>Log In </i> or <span> Sign Up</span>
        </div>
        <div class="am-u-sm-10 login-am-center">
            <form class="am-form" action="" method="post">
                <fieldset>
                    <div class="am-form-group">
                        <input type="password" name="y_pwd" class="y_pwd"  placeholder="原密码">
                    </div><div class="am-form-group">
                        <input type="password" name="x_pwd" class="x_pwd"  placeholder="新密码">
                    </div><div class="am-form-group">
                        <input type="password" name="x_pwd1" class="x_pwd1"  placeholder="确认新密码">
                    </div>
                    <span class="Prompt"></span>
                    <p><button type="button" id="btn" class="am-btn am-btn-default">确认修改</button></p>

                </fieldset>
            </form>

        </div>
    </div>
</div>

<script src="__PUBLIC__/Login/assets/js/jquery.min.js"></script>
<script src="__PUBLIC__/Login/assets/js/amazeui.min.js"></script>
<script src="__PUBLIC__/Login/assets/js/app.js"></script>
<script>

    var Flag = true;
    $('#btn').click(function(){
//        var name=$('#name').val();
        var y_pwd=$('.y_pwd').val();
        var x_pwd=$('.x_pwd').val();
        var x_pwd1=$('.x_pwd1').val();

        if( y_pwd == "" || x_pwd =="" || x_pwd1 == ""){
            $('.Prompt').text("请输入完整的信息").css({color:'red',fontSize:'14px'});
            return false;
        }

        if(x_pwd != x_pwd1){
            $('.Prompt').text("两次密码不一致！").css({color:'red',fontSize:'14px'});
            return false;
        }


        $.ajax({
            type:'get',
            url:"{:U('Login/search')}",
            data:{y_pwd:y_pwd,x_pwd:x_pwd,x_pwd1:x_pwd1},
            dataType:'json',
            async: false,//同步处理
            success:function(msg){
                if(msg.code == 3){
                    Flag = true;
                    alert("修改成功，请重新登录")
                    self.location='login.html';

                }else{
                    Flag = false;
                    $('.Prompt').text(msg.msg).css({color:'red',fontSize:'14px'});
                }
            }
        })
        return Flag;

    })

</script>
</body>
</html>

